package com.oocl.processor.impl;

import java.io.File;
import java.util.Comparator;
import java.util.List;

import com.oocl.analyser.Analyser;
import com.oocl.analyser.impl.AnalyserImpl;
import com.oocl.pojo.Customer;
import com.oocl.printer.FilePrinter;
import com.oocl.printer.impl.FilePrinterImpl;
import com.oocl.processor.FileProcessor;

/**
 * 处理过程实现
 * @author GANAB
 *
 */
public class FileProcessorImpl implements FileProcessor {
	private String format = null;
	private Analyser analyser = null;
	private FilePrinter printer = null;

	public FileProcessorImpl(List<Customer> list, String format) {
		this.format = format;
		this.analyser = new AnalyserImpl(list);
		this.printer = new FilePrinterImpl();
	}

	public boolean process(Comparator<Customer> comp, File file) throws Exception {
		return printer.print(analyser.analyse(comp), format, file);
	}

}
